public class IntegerTest {
	public static void main(String[] args) {
		String str[] = {"123", "123abc", "abc123", "abcxyz"};

		for(String str1 : str){
			try{
				int m = Integer.parseInt(str1, 10);
				System.out.println(str1 + " 可以转换为整数 " + m);
			}catch(Exception e){
				System.out.println(str1 + " 无法转换为整数");
			}
		}
	}
}
